import React, { useState } from 'react'
import { lb } from './request/api'

import { List} from 'antd-mobile'
function App() {
  let num = [4, 4, 1, 1, 1, 2, 2, 2, 2, 3]
  // 数组排序
  num.sort()
  console.log(num)
  // 数组去重
  let aanum = num.filter((i, j, k) => {
    // return  k.indexOf(i)=j
  })
  console.log(aanum)
  let [lbdata, setlbdata] = useState()
  // 接口
  lb({ start: '北京', end: '上海' }).then(res => {
    console.log('lb', res)
    if (res.data.code == 200) {
      setlbdata(res.data.data)
    }
  })
  return (
    <div>
      <List>
        {
          lbdata.map((item,index) => {
           return <List.Item>{item}</List.Item>
          })
          
        }
      </List>

    </div>
  )
}

export default App
